import request from '@/router/axios';

/**
 * 序列号标签打印
 */
export const sequencePrint = (data) => {
  return request({
    url: '/api/mes-admin/label-product/custom/sequence/print/without/definition/id',
    method: 'post',
    data: data
  });
};

// 产品标签生产  外部自定义规则生成序列号
export const outSequenceCreate = (data) => {
  return request({
    url: '/api/mes-admin/label-product/custom/sequence/create/without/definition/id',
    method: 'post',
    data: data
  });
};

// 产品标签生产  外部自定义规则重打
export const outsnReprint = (data) => {
  return request({
    url: '/api/mes-admin/label-product/custom/sequence/reprint/without/definition/id',
    method: 'post',
    params: data
  });
};

//获取打印机配置
export const getLastPrintRecord = (params) => {
  return request({
    url: '/api/mes-admin/label-print-config/get-print-config',
    method: 'POST',
    params: {
      ...params,
      type: 'MATERIAL'
    }
  });
};

export const getDetail = (id) => {
  return request({
    url: '/api/mes-admin/sequencedefinition/detail',
    method: 'get',
    params: {
      id
    }
  });
};

/**
 * 根据原材料收料记录id查询生成记录
 */
export const getSourceList = (params) => {
  return request({
    url: '/api/mes-admin/sequence/generation/source',
    method: 'get',
    params: params
  });
};

// 打印测试
export const printTest = (row) => {
  return request({
    url: '/api/mes-admin/api/print/test',
    method: 'post',
    data: row
  });
};
